home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIXTFElement.idl < prev    next >
Text File  |  2006-05-08  |  7KB  |  167 lines

  1. /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is the Mozilla XTF project.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Alex Fritze.
  19.  * Portions created by the Initial Developer are Copyright (C) 2004
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *   Alex Fritze <alex@croczilla.com> (original author)
  24.  *
  25.  * Alternatively, the contents of this file may be used under the terms of
  26.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  27.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28.  * in which case the provisions of the GPL or the LGPL are applicable instead
  29.  * of those above. If you wish to allow use of your version of this file only
  30.  * under the terms of either the GPL or the LGPL, and not to allow others to
  31.  * use your version of this file under the terms of the MPL, indicate your
  32.  * decision by deleting the provisions above and replace them with the notice
  33.  * and other provisions required by the GPL or the LGPL. If you do not delete
  34.  * the provisions above, a recipient may use your version of this file under
  35.  * the terms of any one of the MPL, the GPL or the LGPL.
  36.  *
  37.  * ***** END LICENSE BLOCK ***** */
  38.  
  39. #include "nsISupports.idl"
  40. interface nsIAtom;
  41. interface nsIDOMDocument;
  42. interface nsIDOMElement;
  43. interface nsIDOMNode;
  44. interface nsIDOMEvent;
  45.  
  46. [scriptable, uuid(a8b607fd-24b6-4a8c-9a89-d9b24f8e2592)]
  47. interface nsIXTFElement : nsISupports
  48. {
  49.   // called when the wrapper object is being destroyed.
  50.   void onDestroyed();
  51.  
  52.   // Constants for attribute elementType:
  53.  
  54.   // Elements of type GENERIC_ELEMENT are required to implement the
  55.   // nsIXTFGenericElement interface in addition to nsIXTFElement:
  56.   const unsigned long ELEMENT_TYPE_GENERIC_ELEMENT = 0;
  57.  
  58.   // Elements of type SVG_VISUAL are required to implement the
  59.   // nsIXTFSVGVisual interface in addition to nsIXTFElement:
  60.   const unsigned long ELEMENT_TYPE_SVG_VISUAL      = 1;
  61.  
  62.   // Elements of type XML_VISUAL are required to implement the
  63.   // nsIXTFXMLVisual interface in addition to nsIXTFElement:
  64.   const unsigned long ELEMENT_TYPE_XML_VISUAL      = 2;
  65.  
  66.   // Elements of type XUL_VISUAL are required to implement the
  67.   // nsIXTFXULVisual interface in addition to nsIXTFElement:
  68.   const unsigned long ELEMENT_TYPE_XUL_VISUAL      = 3;
  69.  
  70.   // Elements of type BINDABLE are required to implement the
  71.   // nsIXTFBindableElement interface in addition to nsIXTFElement:
  72.   const unsigned long ELEMENT_TYPE_BINDABLE        = 4;
  73.  
  74.   // elementType identifies the type of wrapper that will be built for
  75.   // a given xtf element. It must remain constant for the entire
  76.   // lifetime of the xtf element (i.e. before any onCreated()-calls
  77.   // until after onDestroyed()-calls).
  78.   readonly attribute unsigned long elementType;
  79.  
  80.   // If isAttributeHandler is set to 'true', the xtf element indicates
  81.   // that it wants to manage its own attributes. In this case it needs
  82.   // to implement the nsIXTFAttributeHandler interface in addition to
  83.   // its other interfaces. 'isAttributeHandler' must remain constant
  84.   // for the entire lifetime of the xtf element (i.e. before any
  85.   // onCreated()-calls until after onDestroyed()-calls).
  86.   readonly attribute boolean isAttributeHandler;
  87.   
  88.   // getScriptingInterfaces: This array serves 2 purposes: a) All
  89.   // interfaces in this array will automatically be accessible when
  90.   // our wrapper element is used from JS (other interfaces need to be
  91.   // explicitly QI'ed for), and b) All these interfaces are callable
  92.   // from unpriviliged script.
  93.   void getScriptingInterfaces(out unsigned long count,
  94.                               [array, size_is(count), retval] out nsIIDPtr array);
  95.  
  96.   // Notification mask constants:
  97.   // To receive a given event set the corresponding bit in
  98.   // nsIXTFElementWrapper::notificationMask.
  99.   const unsigned long NOTIFY_WILL_CHANGE_DOCUMENT  = 0x00000001;
  100.   const unsigned long NOTIFY_DOCUMENT_CHANGED      = 0x00000002;
  101.   
  102.   const unsigned long NOTIFY_WILL_CHANGE_PARENT    = 0x00000004;
  103.   const unsigned long NOTIFY_PARENT_CHANGED        = 0x00000008;
  104.   
  105.   const unsigned long NOTIFY_WILL_INSERT_CHILD     = 0x00000010;
  106.   const unsigned long NOTIFY_CHILD_INSERTED        = 0x00000020;
  107.   
  108.   const unsigned long NOTIFY_WILL_APPEND_CHILD     = 0x00000040;
  109.   const unsigned long NOTIFY_CHILD_APPENDED        = 0x00000080;
  110.   
  111.   const unsigned long NOTIFY_WILL_REMOVE_CHILD     = 0x00000100;
  112.   const unsigned long NOTIFY_CHILD_REMOVED         = 0x00000200;
  113.   
  114.   const unsigned long NOTIFY_WILL_SET_ATTRIBUTE    = 0x00000400;
  115.   const unsigned long NOTIFY_ATTRIBUTE_SET         = 0x00000800;
  116.   
  117.   const unsigned long NOTIFY_WILL_REMOVE_ATTRIBUTE = 0x00001000;
  118.   const unsigned long NOTIFY_ATTRIBUTE_REMOVED     = 0x00002000;
  119.   
  120.   const unsigned long NOTIFY_BEGIN_ADDING_CHILDREN = 0x00004000;
  121.   const unsigned long NOTIFY_DONE_ADDING_CHILDREN  = 0x00008000;
  122.   
  123.   const unsigned long NOTIFY_HANDLE_DEFAULT        = 0x00010000;
  124.   
  125.   // Event notifications:
  126.  
  127.   void willChangeDocument(in nsIDOMDocument newDoc);
  128.   void documentChanged(in nsIDOMDocument newDoc);
  129.   
  130.   void willChangeParent(in nsIDOMElement newParent);
  131.   void parentChanged(in nsIDOMElement newParent);
  132.  
  133.   void willInsertChild(in nsIDOMNode child, in unsigned long index);
  134.   void childInserted(in nsIDOMNode child, in unsigned long index);
  135.  
  136.   void willAppendChild(in nsIDOMNode child);
  137.   void childAppended(in nsIDOMNode child);
  138.  
  139.   void willRemoveChild(in unsigned long index);
  140.   void childRemoved(in unsigned long index);
  141.  
  142.   void willSetAttribute(in nsIAtom name, in AString newValue);
  143.   void attributeSet(in nsIAtom name, in AString newValue);
  144.  
  145.   void willRemoveAttribute(in nsIAtom name);
  146.   void attributeRemoved(in nsIAtom name);
  147.  
  148.   // These are for batching of child insertions during document load
  149.  
  150.   // beginAddingChildren is called before any attributes or child nodes are
  151.   // added to the element.
  152.   void beginAddingChildren();
  153.   void doneAddingChildren();
  154.  
  155.   // The default handler for DOM Events.
  156.   // This method is called after the normal DOM event flow.
  157.   // If the return value is true, the event is marked as handled and
  158.   // other default handlers won't be able to handle it again.
  159.   boolean handleDefault(in nsIDOMEvent aEvent);
  160.  
  161.   // Set this element to be equivalent to |aElement|.  This does not need
  162.   // to worry about copying attributes or child nodes, but should copy any
  163.   // other needed state.
  164.   void cloneState(in nsIDOMElement aElement);
  165. };
  166.  
  167.